<?php
/**
 * Created by xiaokengge
 * User: zhaoyu
 * Date: 2024/1/25
 * Time: 15:32
 *describe:****
 */

namespace app\api\validate;


class OrderValidate extends BaseValidate
{

    protected $rule = [
        'goods_id'=>'require|isPositiveInteger',//公共ID
        'lat'=>'max:15',
        'lng'=>'max:15',
        'address'=>'max:50',
        'link_name'=>'require|max:6',
        'link_phone'=>'require|isMobile',
        'content'=>'require|max:100',
    ];

    protected $message =[
        'link_phone.require' => '手机号不能为空',
        'link_phone.isMobile' => '手机号格式不对',
        'goods_id.require' => '商品ID不能为空',
        'goods_id.isPositiveInteger' => '商品ID必须为正整数',
        'link_name.require' => '姓名必须填写',
        'link_name.max' => '姓名字数不能超过6个',
        'content.require' => '需求必须填写',
        'content.max' => '需求字数不能超过100个',
    ];

    /**分页场景验证
     * @return UserValidate
     * Author: zhaoyu
     * Date: 2020/8/5 10:44
     */
    public function sceneCreate(){
        return $this->only(['goods_id','lat','lng','address','link_name','link_phone','content']);
    }



}
